eCDF <- function(obj, x, y){
  # This function calculates the joint empirical cdf of bivariate data
  sum((obj[,1] < x) & (obj[,2] < y))/nrow(obj)}